package com.ly.cloud.remote.feign.fallback;

import java.util.Map;

import org.springframework.stereotype.Component;

import com.google.common.collect.Maps;
import com.ly.cloud.exception.CloudException;
import com.ly.cloud.remote.feign.ApprovalServiceFeign;
import com.ly.cloud.web.utils.WebResponse;

/**
 * 审批流程远程调用Feign的异常处理
 * @author caihuihai
 * @date 2018年12月25日 上午11:53:40
 */
@Component
public class ApprovalServiceFeignFallback implements ApprovalServiceFeign {

	private Map<String, Object> getResult(){
		Map<String, Object> map = Maps.newHashMap();
		map.put("code", 500);
		map.put("message", "ly-gzjw-xtsz-svc 远程调用失败");
		return map;
	}

	@Override
	public WebResponse<String> initApproval(String ywzj,String tableName) {
		WebResponse response = new WebResponse();
		response.setData(getResult());
		return response;
	}

	@Override
	public WebResponse<String> processApproval(String ywzj, String tableName, String sprbh, String spyj, String spzt) {
		WebResponse response = new WebResponse();
		response.setData(getResult());
		return response;
	}

	@Override
	public WebResponse<String> genRuleCode(String bbh) {
		WebResponse response = new WebResponse();
		response.setData(getResult());
		return response;
	}

	
}
